package com.example.geckohurricanes;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.Button;

public class HomePageActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.homepage);
		
		//User
		Button upage = (Button) findViewById(R.id.btnuser);
		upage.setOnClickListener(new View.OnClickListener() {
        	public void onClick(View v){
        		Intent myIntent = new Intent(HomePageActivity.this, UserPageActivity.class);
        		startActivity(myIntent);	
        	}
        });

		
		//Logout
		Button logout = (Button) findViewById(R.id.btnlogout);
		logout.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				Intent a = new Intent(getApplicationContext(), LoginActivity.class);
				startActivity(a);
				finish();
			}
		});
		
		//Post Item Page
		Button postItem = (Button) findViewById(R.id.btnpostitem); 
			postItem.setOnClickListener(new View.OnClickListener() {
				public void onClick(View v) {
					Intent b = new Intent(getApplicationContext(), PostItemActivity.class);
					startActivity(b);
				}
			});
			
		Button profilePage = (Button) findViewById(R.id.btnprofilepage); 
		profilePage.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				Intent c = new Intent(getApplicationContext(), ProfilePageActivity.class);
				startActivity(c);
			}
		});	
		
		Button itemPage = (Button) findViewById(R.id.btnsearchitem); 
		itemPage.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				Intent d = new Intent(getApplicationContext(), ItemListPageActivity.class);
				startActivity(d);
			}
		});	
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.home_page, menu);
		return true;
	}

}
